Carbon


ExitToShell

Header: Processes.h Carbon status: Supported

Terminates your application directly.

void ExitToShell ();
DISCUSSION

In general, you need to call ExitToShell only if you want your application to terminate without reaching the end of its main function.

The ExitToShell function terminates the calling process. The Process Manager removes your application from the list of open processes and performs any other necessary cleanup operations. In particular, all memory in your application partition and any temporary memory still allocated to your application is released. If necessary, the Application Died Apple event is sent to the process that launched your application.

If your application was the foreground process at the time it called ExitToShell, its name is removed from the Application menu. The Process Manager selects a new foreground process, switches it into the foreground, and propagates the scrap to the new foreground application.

If your application was the last one running and the shell program is not the Finder, the Process Manager displays a dialog box that gives the user the choice of restarting the computer or shutting it down.

When ExitToShell exits, the system global variable DSErrCode holds its result code.

Any trap patches installed by your application are removed immediately by ExitToShell. They will not affect any trap calls made by ExitToShell itself.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)